package task

const (
	//is64Bit       = 32<<(^uint(0)>>63) == 64 // is64Bit 判断平台是否是64位 64-bit
	shardPrime32  = uint32(16777619)
	shardOffset32 = uint32(2166136261)
)

func fnv32String(v string) uint32 {
	if v == "" {
		return shardOffset32
	}
	hash := shardOffset32
	keyLength := len(v)
	for i := range keyLength {
		hash *= shardPrime32
		hash ^= uint32(v[i])
	}
	return hash
}
